using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace RxjhServer
{
	public class SendGG : Form
	{
		private Button button1;

		private Label label1;

		private TextBox textBox1;

		private Label label3;

		private TextBox textBox2;

		public SendGG()
		{
			InitializeComponent();
		}

		private void button1_Click(object sender, EventArgs e)
		{
			if (textBox2.Text.Length < 2)
			{
				MessageBox.Show("发送内容不能为空");
			}
			else
			{
				try
				{
					int num = int.Parse(textBox1.Text);
					string text = textBox2.Text;
					foreach (Players value in World.allConnectedChars.Values)
					{
						if (value != null)
						{
							switch (num)
							{
							case 0:
								value.系统公告(text);
								break;
							case 1:
								value.系统滚动公告(text);
								break;
							default:
								value.系统提示(text, num, "系统信息");
								break;
							}
						}
					}
					Form1.WriteLine(1, "发送公告：" + text);
				}
				catch (Exception ex)
				{
					Form1.WriteLine(1, "发送公告出错：" + ex.Message);
				}
			}
		}

		private void InitializeComponent()
		{
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RxjhServer.SendGG));
			button1 = new System.Windows.Forms.Button();
			label1 = new System.Windows.Forms.Label();
			textBox1 = new System.Windows.Forms.TextBox();
			label3 = new System.Windows.Forms.Label();
			textBox2 = new System.Windows.Forms.TextBox();
			SuspendLayout();
			button1.Location = new System.Drawing.Point(133, 162);
			button1.Name = "button1";
			button1.Size = new System.Drawing.Size(82, 29);
			button1.TabIndex = 0;
			button1.Text = "发送";
			button1.UseVisualStyleBackColor = true;
			button1.Click += new System.EventHandler(button1_Click);
			label1.AutoSize = true;
			label1.Location = new System.Drawing.Point(12, 23);
			label1.Name = "label1";
			label1.Size = new System.Drawing.Size(29, 12);
			label1.TabIndex = 1;
			label1.Text = "模式";
			textBox1.Location = new System.Drawing.Point(59, 20);
			textBox1.Name = "textBox1";
			textBox1.Size = new System.Drawing.Size(100, 21);
			textBox1.TabIndex = 2;
			textBox1.Text = "10";
			label3.AutoSize = true;
			label3.Location = new System.Drawing.Point(12, 57);
			label3.Name = "label3";
			label3.Size = new System.Drawing.Size(29, 12);
			label3.TabIndex = 5;
			label3.Text = "内容";
			textBox2.Location = new System.Drawing.Point(14, 85);
			textBox2.Multiline = true;
			textBox2.Name = "textBox2";
			textBox2.Size = new System.Drawing.Size(339, 71);
			textBox2.TabIndex = 6;
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(363, 202);
			base.Controls.Add(textBox2);
			base.Controls.Add(label3);
			base.Controls.Add(textBox1);
			base.Controls.Add(label1);
			base.Controls.Add(button1);
			base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			base.Name = "SendGG";
			Text = "发送公告";
			ResumeLayout(false);
			PerformLayout();
		}
	}
}
